package data;

import java.io.IOException;

import org.eclipse.jetty.websocket.WebSocket.Outbound;

public class ClusterInfo {
	public String hostname;
	public String local_hostname;
	public int db_id;
	public Outbound out;
	public volatile boolean isConnected = false;
	
	
	public ClusterInfo(String hname, String lhname)
	{
		this.hostname = hname;
		this.local_hostname = lhname;
	}
	public ClusterInfo(String hname, String lhname, int id)
	{
		this.hostname = hname;
		this.local_hostname = lhname;
		this.db_id = id;
	}
	
	public synchronized void sendMessage(Object data) throws IOException
	{
		out.sendMessage(data.toString());
	}
	
	public void disconnect()
	{
		isConnected = false;
		out.disconnect();
		out = null;
	}

}
